﻿namespace USSDRunner
{
    using System;
    using System.Windows.Navigation;

    /// <summary>
    /// Represents page, responsible for errors displaying.
    /// </summary>
    public partial class ErrorPage
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ErrorPage"/> class.
        /// </summary>
        public ErrorPage()
        {
            InitializeComponent();
        }

        /// <summary>
        /// Gets or sets the exception.
        /// </summary>
        /// <value>
        /// The exception.
        /// </value>
        public static Exception Exception { get; set; }

        /// <summary>
        /// Called when a page becomes the active page in a frame.
        /// </summary>
        /// <param name="e">An object that contains the event data.</param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            ErrorText.Text = Exception.ToString();
        }
    }
}